import http from '@/http'
import qs from 'qs'

// 商户审核相关

// 获取商户审核列表
const merchantApplies = (params) => {
    return http.get('v1/merchantApplies', {
        params,
        paramsSerializer: function (params) {
            return qs.stringify(params, { arrayFormat: 'brackets' })
        },
    })
}

// 审核商户
const auditMerchant = ({ id, params }) => {
    return http.put(`v1/merchantApplies/${id}/audit`, params)
}

// 重新审核商户
const resetAuditMerchant = (id) => {
    return http.put(`v1/merchantApplies/${id}/restartAudit`)
}

export { merchantApplies, auditMerchant, resetAuditMerchant }